﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Nuzzle.Utilities;

namespace Nuzzle
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.Title = "Nuzzle v" + Utilities.Basic.GetNuzzleVersion().ToString();

            Logger.Basic("Starting Nuzzle v" + Utilities.Basic.GetNuzzleVersion().ToString() + " by NightWolf for Dofus v" + Definitions.SUPPORTED_DOFUS_VERSION);

            //Settings
            Logger.Load("Loading app settings ...");
            Settings.Initialize();
            Logger.Loaded("Settings loaded !");

            //Database
            Logger.Load("Try to connect to database ...");
            if (!Database.DatabaseManager.Initialize())
            {
                Logger.Error("Can't connect to database !");
                Console.ReadLine();
                return;
            }
            Logger.Loaded("Connected to database !");

            Logger.Load("Loading breeds datas ...");
            Managers.BreedManager.Initialize();
            Logger.Loaded("Breeds datas loaded !");

            Logger.Load("Initialize cache ...");
            Database.DatabaseCache.Initialize();
            Logger.Loaded("Cache initialized !");

            Network.LoginServer.Initialize();
            Network.GameServer.Initialize();

            while (true)
            {
                Console.ReadLine();
            }
        }
    }
}
